import { TestValidator } from "@nestia/e2e";

export async function test_swagger(): Promise<void> {
  const { NESTIA_CONFIG } = await import(
    __dirname + "/../../../../nestia.config.ts"
  );
  const pack = await import(__dirname + "/../../../../package.json");
  const swagger = await import(__dirname + "/../../../../swagger.json");

  TestValidator.equals("info.version", pack.version, swagger.info.version);
  TestValidator.equals(
    "info.title",
    NESTIA_CONFIG.swagger.info.title,
    swagger.info.title,
  );
  TestValidator.equals(
    "info.description",
    swagger.info.description,
    "Generated by nestia - https://github.com/samchon/nestia",
  );
  TestValidator.equals(
    "servers",
    NESTIA_CONFIG.swagger.servers,
    swagger.servers,
  );
}
